There is known this conventional kind of system disclosed in Japanese Patent Application Laying-open No. 2001-104643. This related art comprises a gun-type controller provided with a light-receiving sensor and an inclination sensor (pointing device) and a display. The light-receiving sensor detects the amount of light by raster-scanning on the display and determines the shooting position based on the result of detection. Additionally, the inclination sensor detects the inclination of the gun-type controller, and switches between offensive mode and defensive mode based on the result of detection.
In the related art, however, the inclination sensor (acceleration sensor) is merely used for mode switching that has nothing to do with a pointing operation. Thus, in such a situation where the light-receiving sensor cannot detect a light source (marker) such as a scanning line, it is impossible to identify the position pointed to by the pointing device, which may interrupt the progress of the game.
Therefore, it is a feature of certain exemplary embodiments to provide a novel game program and game system.
It is another feature of certain exemplary embodiments to provide a game program and game system that make game processing proceed even if it is difficult to identify a position of a point pointed to by a pointing device.
A game program according to the certain exemplary embodiments allows a processor of a game system (10) to execute a position identification step (S35), a position change detection step (S41, S43, S93), a first direction determination step (S97) and a game processing step (S25). The game system comprises a display device (34) for displaying a game screen updated according to progress of game processing, a pointing device (26) for pointing to an arbitrary point in the game screen displayed by the display device, and an acceleration sensor (68) provided in the pointing device.
In the position identification step, a position of the point pointed to by the pointing device is identified at intervals of unit of time. In the position change detection step, a change in the position identified in the position identification step is detected. In the first direction determination step, a movement direction of the pointing device is determined on the basis of the acceleration detected by the acceleration sensor. In the game processing step, the game processing is executed on the basis of a position change when the position change is detected in the position change detection step, or executed on the basis of the movement direction determined in the first direction determination step when no position change is detected in the position change detection step.
According certain exemplary embodiments, when a change in the position of a point pointed to by the pointing device, the game processing is carried out on the basis of the position change, and when no position change is detected, the game processing is carried out on the basis of the movement direction determined from the result of detection by the acceleration sensor, which makes it possible to advance the game processing smoothly with the use of the movement direction of the pointing device even if it is impossible to identify the position of the point pointed to by the pointing device. The movement direction includes at least one of the speed direction and the acceleration direction.
A game program according to certain exemplary embodiments allows the processor to further execute an acceleration determination step (S5). In the acceleration determination step, it is determined whether or not the acceleration detected by the acceleration sensor is equal to or more than a threshold value. In the position identification step, position identification is carried out only for a time period during when it is determined in the acceleration determination step that the acceleration is equal to or more than the threshold value.
According to certain exemplary embodiments, position identification can be performed with a high degree of efficiency. It is also possible to prevent the game processing from being advanced by the player's unintentional moving the pointing device due to hand shake, etc.
A game program according to certain exemplary embodiments allows the processor to further execute a second direction determination step (S95). In the second direction determination step, the movement direction of the pointing device is determined based on, out of a plurality of positions detected within the time period in the position identification step, a first detected position and a last detected position.
According to certain exemplary embodiments, the movement direction can be determined with ease and accuracy.
In a game program according to certain exemplary embodiments, in the first direction determination step, direction determination is carried out only for the time period.
According to certain exemplary embodiments, the determination of the movement direction can be carried out with efficiency. It is also possible to prevent the game processing from being wrongly advanced due to the player's unintentional movement.
The game processing according to certain exemplary embodiments includes a process of deciding a path in the game screen corresponding to the movement of the pointing device. In the game processing step, when a position change is detected in the position change detection step, the path is decided on the basis of a plurality of positions identified in the position identification step, and when no position change is detected in the position change detection step, the path is decided on the basis of the movement direction determined in the first direction determination step and a preset position.
According to certain exemplary embodiments, it is possible to decide a path based on the determined movement direction even if no position change is detected. In addition, if a position change is detected, it is possible to decide the path with accuracy based on the plurality of identified positions, preferably based on the two positions, the first and last ones out of the plurality of identified positions.
A game program according to certain exemplary embodiments allows the processor to further execute a first direction calculation step (S17), a second direction calculation step (S19), and a third direction calculation step (S21). In the first direction calculation step, a speed direction of the pointing device in a local coordinate system moving together with the pointing device is calculated by accumulatively adding a change in acceleration detected by the acceleration sensor. In the second direction calculation step, a gravity direction in the local coordinate system is calculated by accumulatively adding an acceleration detected by the acceleration sensor.
In the third direction calculation step, a speed direction in a stationary coordinate system is calculated by subjecting the speed direction calculated in the first direction calculation step to a rotational operation so that the gravity direction calculated in the second direction calculation step matches a gravity direction in the stationary coordinate system. The determination in the first direction determination step is made on the basis of a result of calculation in the third direction calculation step, that is, on the basis of the speed direction in the stationary coordinate system.
According to certain exemplary embodiments, it is possible to carry out the game processing accurately with the use of the speed direction in the stationary coordinate system.
The acceleration sensor according to certain exemplary embodiments detects acceleration components in three directions. In each of the first direction calculation step, the second direction calculation step and the third direction calculation step, calculation is carried out on two acceleration components corresponding to any two of the three directions. In the acceleration determination step, determination is carried out on the remaining one of the three directions.
According to the certain exemplary embodiments, the calculations in the first to third direction calculation steps are performed only on the acceleration components in the two directions, resulting in a decrease in processing load. The determination in the acceleration determination step is carried out on the acceleration component in the remaining one direction, which allows the game to be advanced accurately and efficiently by means of the single three-direction acceleration sensor.
A game program according to certain exemplary embodiments allows the processor to include a correction step (S15). The acceleration sensor has a predetermined detectable range. In the correction step, when the acceleration of the pointing device exceeds the detectable range, the acceleration detected by the acceleration sensor is corrected.
According to certain exemplary embodiments, when the acceleration of the pointing device exceeds the detectable range of the acceleration sensor, the detected acceleration is corrected in the correction step.
In the correction step of certain exemplary embodiments, correction is made with use of Bazier curve (C) defined by the acceleration detected by the acceleration sensor when the acceleration of the pointing device falls within the detectable range.
According to certain exemplary embodiments, the accuracy of direction determination is increased, making it possible to accommodate even a movement exceeding the detectable range of the acceleration sensor.
A game program according to certain exemplary embodiments allows the processor to further execute a gravity direction calculation step (S165 to S177) and an acceleration direction calculation step (S105). In the gravity direction calculation step, an acceleration detected by the acceleration sensor is accumulatively added, whereby a gravity direction in a local coordinate system moving together with the pointing device is determined. In the acceleration direction calculation step, the acceleration detected by the acceleration sensor is subjected to a rotational process so that the gravity direction in the stationary coordinate system matches the gravity direction calculated in the gravity direction calculation step, whereby a direction of acceleration in a stationary coordinate system is calculated is determined. The determination in the first direction determination step is made on the basis of a result of calculation in the acceleration direction calculation step, that is, on the basis of the direction of the acceleration in the stationary coordinate system.
According to certain exemplary embodiments, it is possible to carry out the game processing with accuracy by using the acceleration direction in the stationary coordinate system, regardless of the position of the pointing device.
The acceleration sensor according to certain exemplary embodiments detects acceleration components in three directions. In each of the direction calculation step and the acceleration calculation step, calculation is carried out on three acceleration components corresponding to the three directions.
According to certain exemplary embodiments, the calculated acceleration can be reflected on a three-dimensional game screen. It is also possible to make the game using the acceleration progress with accuracy even on a two-dimensional game screen.
A game program according to certain exemplary embodiments further comprises a plurality of light-emitting elements (24a, 24b) provided in proximity to a screen of the display device. The optical pointing device includes an imaging unit (72) for imaging an object scene containing the plurality of light-emitting elements. In the position identification step, the position pointed to by the pointing device is identified on the basis of an image of the object scene imaged by the imaging unit.
A game system according to certain exemplary embodiments comprises a display device (34) for displaying a game screen updated according to progress of game processing, a pointing device (26) for pointing to an arbitrary point in the game screen displayed by the display device, an acceleration sensor (68) provided in the pointing device, a position identification means (S35) for identifying a position of the point pointed to by the pointing device at intervals of unit of time, a position change detection means (S41, S43, S93) for detecting a change in the position identified by the position identification means, a first direction determination means (S97) for determining a movement direction of the pointing device, based on the acceleration detected by the acceleration sensor, and a game processing means (S25) for executing the game processing based on a position change when the position change is detected by the position change detection means, or executing the game processing based on the movement direction determined by the first direction determination means when no position change is detected by the position change detection means.
According to certain exemplary embodiments, it is possible to make the game processing advance smoothly using the movement direction of the pointing device even if it is impossible to identify the position of the point pointed to by the pointing device.
According to certain exemplary embodiments, the game processing can be advanced smoothly even if it is impossible to identify the position of the point pointed to by the pointing device.
The above described features, aspects and advantages of the certain exemplary embodiments described herein will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.